<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>1</title>
    <script src="https://unpkg.com/vue@next"></script>
</head>

<body>
    <div id='root'>
       <counter >
           <div>提交{{counter}}</div>
       </counter>
       <counter>
           <button>提交btn{{counter}}</button>
       </counter>  
    </div>
    <script>
        
        
        let app = Vue.createApp({
            data() {
                return {
                   counter:'aaaa'
                }
            }
        })
        
        app.component('counter',{
           
            template:`
                <div>
                    <input />
                    <span @click="handleClick">
                        <slot></slot>    
                    </span>
                </div>
            `,
            methods:{
                handleClick(){
                    alert(1)
                }
            }
            
        }) 

        let vm = app.mount('#root')
    </script>
</body>
</html>